package edu.hgnc.tx.annotation.service;

import edu.hgnc.tx.annotation.dao.BookDao;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.Arrays;

public class BookService {

	private static final Log logger = LogFactory.getLog(BookService.class);

	@Autowired
	private BookDao bookDao;

	public void setBookDao(BookDao bookDao) {
		logger.debug("===setBookDao===");
		this.bookDao = bookDao;
	}

	/**
	 * 模拟结账：传入用户，id
	 * @param username
	 * @param id
	 */
	@Transactional
	public void checkout(String username, int id) {
		logger.debug("args[]"+ Arrays.asList(username,id));
		bookDao.test();
	}
}
